package br.com.biblioteca.vo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.Version;

/**
 *
 * @author joaosavio
 */
@Entity
public class Book implements Serializable {

    public static enum Area {
        biology, english
    }

    @Version
    private int version;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    @Column(length = 60, nullable = false)
    private String title;

    @Column(length = 60, nullable = false)
    private String autor;

    @Temporal(javax.persistence.TemporalType.DATE)
    private Date date;

    @Column(length = 60, nullable = false)
    private String editora;

    @Column(nullable = false)
    private long isbn;

    @Column(length = 20, nullable = false)
    private String area;

    @Column(nullable = false)
    private long loanSum;

    @Column(nullable = false)    
    private int borrowed = 0;

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAutor() {
        return autor;
    }

    public void setAutor(String autor) {
        this.autor = autor;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getEditora() {
        return editora;
    }

    public void setEditora(String editora) {
        this.editora = editora;
    }

    public long getIsbn() {
        return isbn;
    }

    public void setIsbn(long isbn) {
        this.isbn = isbn;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public long getLoanSum() {
        return loanSum;
    }

    public void setLoanSum(long loanSum) {
        this.loanSum = loanSum;
    }

    public int getBorrowed() {
        return borrowed;
    }

    public void setBorrowed(int borrowed) {
        this.borrowed = borrowed;
    }   
}
